/**
 * Created with CLion.
 * Description: 
 * User: loong
 * Date: 2023/12/24
 * Time: 22:08
 */

#ifndef CODSEEGMENT_NODEIMPL_H
#define CODSEEGMENT_NODEIMPL_H
#include "Node.h"
#include <QtCore>

#include "pugixml/pugiconfig.hpp"
#include "pugixml/pugixml.hpp"

namespace Config {
    using namespace pugi;
    class NodeImpl
    {
        friend class Node;
    public:
        NodeImpl(std::string _tag, std::string _value);
        NodeImpl();
        ~NodeImpl() = default;

        static xml_document ToXmlNode(NodeSPtr _node);
        static NodeSPtr ToNode(xml_node _node);

    private:
        xml_document doc_;

        std::string tag_name_;
        std::string value_;

        NodeWPtr                    parent_;
        QMap<std::string, NodeList> children_map_;
        NodeList                    children_list_;
        NodeAttrs                   attribute_;
    };

}// namespace Config

#endif//CODSEEGMENT_NODEIMPL_H
